package demo3;

public class Test {
    public static void main(String[] args) {
        test();
        //test1();
    }
    public static void test() {
        /*Shapes shape = new Flower();
        shape.draw();
        System.out.println("------------");*/
        Shapes[] shapes = {new Flower(),new Cycle(),new Flower(),new Flower(),new Triangle()};
        for (Shapes s:shapes) {
            s.draw();
        }
    }
    public static void test1() {
        Flower flower = new Flower();
        Cycle cycle = new Cycle();
        String[] shapes = {"flower","cycle","flower","flower"};
        for (String s:shapes) {
            if(s.equals("flower")){
                flower.draw();
            }else if(s.equals("cycle")) {
                cycle.draw();
            }
        }
    }
}
